//
//  CommentView.m
//  meiyinxiang
//
//  Created by 媒印象 on 2018/1/8.
//  Copyright © 2018年 hbjApple. All rights reserved.
//

#import "CommentView.h"
#import "MYXRecommendDetailController.h"
@interface CommentView ()
@property (weak, nonatomic) IBOutlet UIButton *collectionBtn;
@property (weak, nonatomic) IBOutlet UIButton *zanBtn;

@end

@implementation CommentView
- (void)setDetailModel:(MYXDetailViewModel *)detailModel{
    _detailModel = detailModel;
    [self.collectionBtn setTitle:detailModel.markcount forState:UIControlStateNormal];
    [self.zanBtn setTitle:detailModel.zancount forState:UIControlStateNormal];
    [self.commendBtn setTitle:detailModel.commentcount forState:UIControlStateNormal];}
- (IBAction)commendBtn:(id)sender {
    if (_detailModel.comment_status.integerValue == -1) {
        ShowSVProgressErrorMessage(@"您未抢到红包，暂时无法评论！！");
    }else if (_detailModel.comment_status.integerValue == 1){
        MYXRecommendDetailController *recommendDetailVC = [[MYXRecommendDetailController alloc] init];
        recommendDetailVC.redPacketId = self.detailModel.smallLuckyMoneyId;
        recommendDetailVC.commentManId = [MYXMemberMdel sharedInstance].userinfo.userid;
        [self.mSuperVC.navigationController pushViewController:recommendDetailVC animated:YES];
        NSLog(@"进入评价详情页面");
    }else if (_detailModel.comment_status.integerValue == 2){
        [self.detailModel showCommentTextWithFinshBlock:^(BOOL isSucess) {
            [self.detailModel hidekeybord];
            if (isSucess) {
                [[NSNotificationCenter defaultCenter] postNotificationName:PostCommendSucessNOtificationName object:nil];
            }
        }];
    }
    }
- (IBAction)zanBtn:(id)sender{
    
}
- (IBAction)collectionBtn:(id)sender{
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
